#ifndef MAINTAIN_TABLEVIEW_H
#define MAINTAIN_TABLEVIEW_H

#include <QTableView>
#include <QHeaderView>

class MaintainTableModel;
class MaintainProgressBarDelegate;
class MaintainButtonDelegate;

enum EUM_MAINTAIN_ITEM {
    EM_MI_CAN,
    EM_MI_USB,
    EM_MI_BUZZER,
    E_MI_PIPETTE,
    E_MI_MOTION,
    E_MI_HEATING
};


class MaintainTableView : public QTableView
{
    Q_OBJECT

public:
    // The default constructor
    explicit MaintainTableView(QWidget *parent = 0);

    // Get the table model
    MaintainTableModel* tableModel() {return m_pModel;}

    // The default destructor
    ~MaintainTableView();

    // Reset the value on table view
    void ResetView();

    // Get the values under an column
    QStringList GetValue(int nColIdx);

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

signals:
    // The event that startup test after click an button
    void signalButtonClicked(int nRowIdx, bool bAction);

    // The event that display the result after stop test
    void signalProgressFinished(int nRowIdx);

private slots:

private:
    // After constructing object, initialize the object
    void _Initialze();

    // Init the window style
    void _InitUi();

private:
    MaintainTableModel *            m_pModel;
    MaintainProgressBarDelegate *   m_pProgressBarDelegate;
    MaintainButtonDelegate *        m_pButtonDelegate;
};

#endif // MAINTAIN_TABLEVIEW_H
